{% extends 'userbase.html' %}
{% block title %}我的主页{% endblock %}
{% block head_title %}我的主页{% endblock %}
{% load staticfiles %}
{% block framework %}
    <div class="cw1000">
	<div class="w280 fl">
		<div class="public_box">
			<div class="public_title">
				<h2>游记评论</h2>
			</div>
			<!-----------------首页游记评论---------------->
			<div class="comments_list">
				<ul>
                    {% for diary_comment in diary_comments %}
                        <li>
						<div class="note">
							<div class="pic"><img src="{{ MEDIA_URL }}{{ diary_comment.diary.user.portrait }}"/></div>
							<div class="con">
								<a href="{% url 'diarys:details' diary_comment.diary.id %}"><h3>{{ diary_comment.diary.title }}</h3></a>
								<p>作者：<span>{{ diary_comment.diary.user.nickname }}</span><label>{{ diary_comment.diary.commentsnum }}个评论</label></p>
							</div>
						</div>
						<div class="text">
							<p>我评论：{{ diary_comment.comments }}</p>
						</div>
					</li>
                    {% endfor %}
				</ul>
				<div class="h_more"><a href="{% url 'mycomments' %}?comments_type=note">共<b>{{ diary_comments_count }}</b>条评论</a></div>
			</div>
		</div>
		<div class="public_box">
			<div class="public_title">
				<h2>景区评论</h2>
			</div>
			<!-----------------首页景区评论---------------->
			<div class="comments_list">
				<ul>
                    {% for spots_comment in spots_comments %}
                        <li>
						<div class="scenic">
							{% if spots_comment.spots.classification == 'natural' %}
                            <div class="tip"><img src="{% static 'images/scenic_ico.png' %}">景区</div>
                        {% elif spots_comment.spots.classification == 'leisure' %}
                            <div class="tip"><img src="{% static 'images/leisure_ico.png' %}">休闲</div>
                        {% else %}

                        {% endif %}
							<a href="{% url 'scenicspots:scenic_detail' spots_comment.spots.id %}"><h3>{{ spots_comment.spots.name }}</h3></a>
							<div class="clear"></div>
						</div>
						<div class="text">
							<p>我评论：{{ spots_comment.comments }}</p>
						</div>
					</li>
                    {% endfor %}
				</ul>
				<div class="h_more"><a href="{% url 'mycomments' %}?comments_type=scenic">共<b>{{ spots_comments_count }}</b>条评论</a></div>
			</div>
		</div>
		<div class="public_box">
			<div class="public_title">
				<h2>活动评论</h2>
			</div>
			<!-----------------首页活动评论---------------->
			<div class="comments_list">
				<ul>
                    {% for actives_comment in actives_comments %}
                        <li>
						<div class="activities">
							<a href="{% url 'scenicspots:active_detail' actives_comment.active.id %}"><h3>{{ actives_comment.active.title }}</h3></a>
							<label>￥{{ actives_comment.active.price }}</label>
						</div>
						<div class="text">
							<p>我评论：{{ actives_comment.comments }}</p>
						</div>
					</li>
                    {% endfor %}
				</ul>
				<div class="h_more"><a href="{% url 'mycomments' %}?comments_type=active">共<b>{{ actives_comments_count }}</b>条评论</a></div>
			</div>
		</div>
		<div class="public_box">
			<div class="public_title">
				<h2>商品评论</h2>
			</div>
			<!-----------------首页商品评论---------------->
			<div class="comments_list">
				<ul>
                    {% for project_comment in project_comments %}
                        <li>
						<div class="project">
							<a href="{% url 'shop:pro_detail' project_comment.product.id %}"><h3>{{ project_comment.product.name }}</h3></a>
							<label>￥{{ project_comment.product.price }}</label>
						</div>
						<div class="text">
							<p>我评论：{{ project_comment.comments }}</p>
						</div>
					</li>
                    {% endfor %}
				</ul>
				<div class="h_more"><a href="#">共<b>{{ project_comments_count }}</b>条评论</a></div>
			</div>
		</div>
	</div>
	<div class="w700 fr">
		<div class="public_box">
			<div class="public_title">
				<h2>我的游记</h2>
			</div>
			<!-----------------游记列表---------------->
			<div class="note_list">
				<ul>
                    {% for diary in diarys %}
                        <li>
						<div class="pic"><img src="{{ MEDIA_URL }}{{ diary.image }}"/></div>
						<div class="con">
							<a href="{% url 'diarys:details' diary.id %}"><h3>{{ diary.title }}</h3></a>
							<div class="user">
								<span><img src="{{ MEDIA_URL }}{{ diary.user.portrait }}" />作者：<font>木子</font></span>
								<label><img src="{% static 'images/state_icon1.png' %}" />{{ diary.checknum }}</label>
								<label><img src="{% static 'images/state_icon2.png' %}" />{{ diary.commentsnum }}</label>
							</div>
							<p>{{ diary.content|striptags|truncatechars:"100"  }}</p>
						</div>
					</li>
                    {% endfor %}
				</ul>
				<div class="h_more"><a href="#">共<b>{{ diarys_count }}</b>篇游记</a></div>
			</div>
		</div>
		<div class="public_box">
			<div class="public_title">
				<h2>我的收藏</h2>
			</div>
			<!-----------------游记列表---------------->
			<div class="note_list">
				<ul>
                    {% for collect in collects %}
                        <li>
						<div class="pic"><img src="{{ MEDIA_URL }}{{ collect.diary.image }}"/></div>
						<div class="con">
							<a href="{% url 'diarys:details' collect.diary_id %}"><h3>{{ collect.diary.title }}</h3></a>
							<div class="user">
								<span><img src="{{ MEDIA_URL }}{{ collect.diary.user.portrait }}" />作者：<font>{{ collect.diary.user.nickname }}</font></span>
								<label><img src="{% static 'images/state_icon1.png' %}" />{{ collect.diary.checknum }}</label>
								<label><img src="{% static 'images/state_icon2.png' %}" />{{ collect.diary.commentsnum }}</label>
							</div>
							<p>{{ collect.diary.content|striptags|truncatechars:"100" }}</p>
						</div>
					</li>
                    {% endfor %}
				</ul>
				<div class="h_more"><a href="{% url 'mycollect' %}">共<b>{{ collects_count }}</b>篇收藏</a></div>
			</div>
		</div>
		<div class="public_box">
			<div class="public_title">
				<h2>旅游订单</h2>
			</div>
			<!-----------------旅游订单---------------->
			<div class="order_list">
				<div class="column_title">
					<ul>
						<li style="width:35%;">订单信息</li>
						<li style="width:10%;">数量</li>
						<li style="width:10%;">单价</li>
						<li style="width:10%;">总价</li>
						<li style="width:20%;">订单状态</li>
						<li style="width:15%;">操作</li>
					</ul>
				</div>
				<div class="list_con">
					<ul>
                        {% for order in scenic_orders %}
                            <li>
							<div class="serial">订单编号：{{ order.order_num }}<a href="#"><i class="del"></i>删除</a></div>
							<div class="cont">
								<div class="con">
									<div class="info" style="width:35%;">
										<div class="pic"><a href="{% if order.classification == 'mp' %}
                                                                {% url 'scenicspots:scenic_detail' order.scenic_id %}
                                                              {% elif order.classification == 'hd' %}
                                                                {% url 'scenicspots:active_detail' order.scenic_id %}
                                                              {% else %}
                                                                #
                                                              {% endif %}">
                                            <img width=53 height=53 src="{{ MEDIA_URL }}{{ order.scenic_image }}" /></a></div>
										<div class="name">
											<a href="{% if order.classification == 'mp' %}
                                                                {% url 'scenicspots:scenic_detail' order.scenic_id %}
                                                              {% elif order.classification == 'hd' %}
                                                                {% url 'scenicspots:active_detail' order.scenic_id %}
                                                              {% else %}
                                                                #
                                                              {% endif %}">{{ order.order_describe|truncatechars:"10" }}</a>
											<p>下单日期：{{ order.create_time|date:"Y-m-d" }}</p>
										</div>
										<div class="clear"></div>
									</div>
									<div class="number" style="width:10%;">x{{ order.buy_num }}</div>
									<div class="price" style="width:10%;">￥{{ order.ticket_price }}</div>
									<div class="m_price" style="width:10%;"><div class="middle">￥{{ order.total_amount }}</div></div>
									{% if order.order_state == 'wzf' %}
                                    <div class="state" style="width:20%;">
									<div class="middle">
										<p>未付款</p>
										<a href="{% url 'scenicspots:order_detail' order.order_num %}">订单详情</a>
									</div>
								</div>
								    <div class="operation" style="width:15%;">
									<div class="middle">
										<a class="buy" href="{% if order.classification == 'mp' %}
                                                            {% url 'pay:submit_order' %}?from=tickets_order&order_num={{ order.order_num }}
                                                            {% elif order.classification == 'hd' %}
                                                            {% url 'pay:submit_order' %}?from=actives_order&order_num={{ order.order_num }}
                                                            {% else %}
                                                            #
                                                            {% endif %}">去付款</a>
									</div>
								</div>
                                {% elif order.order_state == 'yzf' %}
                                         <div class="state" style="width:20%;">
									<div class="middle">
										<p>待评价</p>
										<a href="{% url 'scenicspots:order_detail' order.order_num %}">订单详情</a>
									</div>
								</div>
								    <div class="operation" style="width:15%;">
									<div class="middle">
										<a class="buy" href="{% url 'operation:commentspots' %}?order_num={{ order.order_num }}">评价</a>
									</div>
								</div>
                                {% else %}
                                    <div class="state" style="width:20%;">
									<div class="middle">
										<p>已完成</p>
										<a href="{% url 'scenicspots:order_detail' order.order_num %}">订单详情</a>
									</div>
								</div>
								    <div class="operation" style="width:15%;">
									<div class="middle">
										<a class="buy" href="#">申请售后</a>
									</div>
								</div>
                                {% endif %}
									<div class="clear"></div>
								</div>
							</div>
						</li>
                        {% endfor %}
					</ul>
				</div>
				<div class="h_more"><a href="{% url 'pay:scenic_order'%}">共<b>{{ scenic_orders_count }}</b>个订单</a></div>
			</div>
		</div>
		<div class="public_box">
			<div class="public_title">
				<h2>商品订单</h2>
			</div>
			<!-----------------商品订单---------------->
			<div class="order_list">
				<div class="column_title">
					<ul>
						<li style="width:35%;">订单信息</li>
						<li style="width:10%;">数量</li>
						<li style="width:10%;">单价</li>
						<li style="width:10%;">总价</li>
						<li style="width:20%;">订单状态</li>
						<li style="width:15%;">操作</li>
					</ul>
				</div>
				<div class="list_con">
					<ul>
                        {% for project_order in project_orders %}
                            <li>
							<div class="serial">订单编号：{{ project_order.order_num }}<a href="#"><i class="del"></i>删除</a></div>
							<div class="cont">
                                {% for goods in project_order.goods_list %}
								    <div class="con">
								<div class="info" style="width:35%;">
									<div class="pic"><a href="{% url 'shop:pro_detail' goods.good_id %}"><img width=53 height=53 src="{{ MEDIA_URL }}{{ goods.good_image }}" /></a></div>
									<div class="name">
										<a href="{% url 'shop:pro_detail' goods.good_id %}">{{ goods.good_name|truncatechars:"12" }}</a>
										<p>下单日期：{{ project_order.create_time|date:"Y-m-d" }}</p>
									</div>
									<div class="clear"></div>
								</div>
								<div class="number" style="width:10%;">x{{ goods.good_num }}</div>
								<div class="price" style="width:10%;">￥{{ goods.good_price }}</div>
                                {% if forloop.counter == 1 %}
                                    <div class="m_price" style="width:10%;"><div class="middle">￥{{ project_order.totalprice }}</div></div>
                                    {% if project_order.order_state == 'wzf' %}
                                    <div class="state" style="width:20%;">
									<div class="middle">
										<p>未付款</p>
										<a href="{% url 'shop:order_detail' project_order.order_num %}">订单详情</a>
									</div>
								</div>
								    <div class="operation" style="width:15%;">
									<div class="middle">
										<a class="buy" href="{% url 'pay:submit_order' %}?from=goods_order&order_num={{ project_order.order_num }}">去付款</a>
									</div>
								</div>
                                {% elif project_order.order_state == 'yzf' %}
                                    <div class="state" style="width:20%;">
									<div class="middle">
										<p>待收货</p>
										<a href="{% url 'shop:order_detail' project_order.order_num %}">订单详情</a>
									</div>
								</div>
								    <div class="operation" style="width:15%;">
									<div class="middle">
										<a class="buy" href="{% url 'operation:confirmgoods' %}?order_num={{ project_order.order_num }}">确认收货</a>
									</div>
								</div>
                                {% elif project_order.order_state == 'ysh' %}
                                         <div class="state" style="width:20%;">
									<div class="middle">
										<p>待评价</p>
										<a href="{% url 'shop:order_detail' project_order.order_num %}">订单详情</a>
									</div>
								</div>
								    <div class="operation" style="width:15%;">
									<div class="middle">
										<a class="buy" href="{% url 'operation:commentsgoods' %}?order_num={{ project_order.order_num }}">评价</a>
									</div>
								</div>
                                {% else %}
                                    <div class="state" style="width:20%;">
									<div class="middle">
										<p>已完成</p>
										<a href="{% url 'shop:order_detail' project_order.order_num %}">订单详情</a>
									</div>
								</div>
								    <div class="operation" style="width:15%;">
									<div class="middle">
										<a class="buy" href="#">申请售后</a>
									</div>
								</div>
                                {% endif %}
                                {% endif %}
								<div class="clear"></div>
							</div>
                                {% endfor %}
							</div>
						</li>
                        {% endfor %}
					</ul>
				</div>
				<div class="h_more"><a href="{% url 'pay:project_order' %}">共<b>{{ project_orders_count }}</b>个订单</a></div>
			</div>

		</div>
	</div>
	<div class="clear"></div>
</div>
{% endblock %}